package org.imsetal.ilpointservice.controller;

import jakarta.annotation.Resource;
import org.imsetal.ilapi.utils.Result;
import org.imsetal.ilpointservice.service.DailyCheckInService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("dailyCheckIn")
public class DailyCheckInController {
    @Resource
    private DailyCheckInService dailyCheckInService;

    @GetMapping("getCheckedToday")
    public Result getCheckedToday(Long userid) {
        return Result.success(dailyCheckInService.checkedToday(userid));
    }

    @GetMapping("")
    public Result dailyCheckIn(@RequestParam Long userid) {
        String info=dailyCheckInService.dailyCheckIn(userid);
        return Result.success(info);
    }

    @GetMapping("getUserCheckedBook")
    public Result getUserCheckedBook(@RequestParam Long userid) {
        return Result.success(dailyCheckInService.getDailyCheckInListByUserId(userid));
    }
}
